<template>
	<div class='header'>
		<header>
			<i class="iconfont icon-return"  @click="goBack"></i>
			<slot>
				<span>我的地址</span>
			</slot>
			<i class="iconfont icon-kefu"></i>
		</header>
	</div>
	
</template>

<script>
	export default{
		name:"Header",
		methods:{
			goBack(){
			    if(this.$route.name == "path-list"){
					//跳转下一页，关闭当前页
					this.$router.replace("/path")
				}else{
					this.$router.push('/my')
				}
				
				
			}
		}
	}
</script>

<style scoped lang="less">
	header{
		display: flex;
		justify-content: space-between;
		align-items: center;
		height: 1rem;
		color:#fff;
		background-color: #b0352f;
		
		i{
			padding:0 0.4rem;
			font-size: 0.5rem;
		}
		span{
			padding: 0 0.4rem;
			font-size: 0.4rem;
		}
	}
</style>